package com.csg.ses.controller;

import com.csg.ses.common.annotation.LoginToken;
import com.csg.ses.entity.ses.VUserInfoEntity;
import com.csg.ses.service.ses.VUserInfoService;
import com.csg.ses.vo.common.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 人员选择列表
 * @author wangjun
 * @date 2020/11/16
 */
@RestController
@RequestMapping("/person-select")
@Api(tags = "人员选择列表接口")
public class VUserInfoController {
    @Autowired
    private VUserInfoService vUserInfoService;

    /**
     * 人员选择列表
     */
    @ApiOperation(value = "人员选择列表")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "user", value = "人员信息", dataType = "VUserInfoEntity", paramType = "body"),
        @ApiImplicitParam(name = "current", value = "当前页", required = true ,dataType = "Integer"),
        @ApiImplicitParam(name = "size", value = "每页记录数", required = true ,dataType = "Integer")
    })
    @GetMapping("")
    @LoginToken
    public Result<List<VUserInfoEntity>> list(VUserInfoEntity user, Long current, Long size) {
        return vUserInfoService.retrieve(user, current, size);
    }
}